#ifndef __graph_H__
#define __graph_H__

#define Default_Vertex_Size 10 //默认顶点数
#define datatype char

typedef struct Graph
{
	int MaxVertex;
	int NumVertex;
	int NumEdge;
	datatype *VertexList;
	int **Edge;
} Graph;

int Init(Graph *);

void Show(Graph *graph);

int InsertVertex(Graph *graph, datatype vertex);

int InsertEdge(Graph *graph, datatype vertex1, datatype vertex2);

int GetVertexPosition(Graph *graph, datatype vertex);

int RemoveVertex1(Graph *graph, datatype vertex); //删除顶点方法1：删除顶点的后续顶点前移一位

int RemoveVertex2(Graph *graph, datatype vertex); //删除顶点方法2：末尾顶点顶替删除顶点的位置

int RemoveEdge(Graph *graph, datatype vertex1, datatype vertex2);

void DestoryGraph(Graph *graph);

int GetFirstNeighbor(Graph *graph, datatype vertex);

int GetNextNeighbor(Graph *graph, datatype vertex1, datatype vertex2);

#endif
